M.Page.test = M.createClass();
M.extend(M.Page.test.prototype,
{
	context: {},
	submittext:"处理中...",
	init: function () {
		this.initDOM();
		this.initEvent();
	},
	initDOM: function () {
		this.context.all = $('#all');//获取对象
		this.context.id_float = $('#id_float');
		this.context.id_next = $('#id_next');
	},
	initEvent:function() {
		this.context.all.bind("click",this.all_click.toEventHandler(this));//绑定事件
	},
	all_click:function(e){
		var ele = M.EventEle(e);
		var t = ele.attr('tag');
		switch(t){
			case 'time':
				this._time(ele);//调用自己的函数
				break;
			case 'popup':
				this._popup(ele);
				break;
			case 'float':
				this._float(ele);
				break;
			case 'next':
				this._next(ele);
				break;
			case 'closebtn':
				if(ele.parents('div[tag=xia]').attr('id')!='id_text'){
					M.ClosePopup();
				}
				break;
		}
	},
	_time:function(ele){
		ele.children('span[tag=number]').html(M.timeformat(M.strtotime('2014-1-3'),'Y/m/d'))
	},
	_popup:function(ele){
		alert(ele.html());
	},
	_float:function(ele){
		M.Popup(this.context.id_float,{"hideclass":"modal fade h-orderpop","showclass":"modal fade h-orderpop in"},function(){}.toEventHandler(this));
	},
	_next:function(){
		M.ClosePopup();
		M.Popup(this.context.id_next,{"hideclass":"modal fade h-orderpop","showclass":"modal fade h-orderpop in"},function(){}.toEventHandler(this));
	}

});


M.ready(function(){
	test = new M.Page.test();
	return test;
});







